package com.jswlw.service.biz.impl;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.jswlw.dao.biz.DevFilterMapper;
import com.jswlw.entity.biz.DevFilter;
import com.jswlw.service.biz.DevFilterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

/**
 * @author 吴维斌 E-mail:wuweibin0817@163.com
 * @version 创建时间：${date} ${time}
 */
@Service
public class DevFilterServiceImpl implements DevFilterService {
    @Autowired
    DevFilterMapper mapper;

    @Override
    public void add(DevFilter devFilter) {
        mapper.insertSelective(devFilter);
    }

    @Override
    public void update(DevFilter devFilter) {
        mapper.updateByPrimaryKeySelective(devFilter);
    }

    @Override
    public void delete(Integer id) {
        mapper.deleteByPrimaryKey(id);
    }

    @Override
    public DevFilter find4Id(Integer id) {
        return mapper.selectByPrimaryKey(id);
    }

    @Override
    public List<DevFilter> queryList(DevFilter filter) {
        return mapper.queryList(filter);
    }

    @Override
    public Page<DevFilter> queryPage(DevFilter filter, Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        return (Page<DevFilter>) mapper.queryList(filter);
    }

    @Override
    public void delete4DevId(String id) {
        mapper.delete4DevId(id);
    }

    @Override
    public List<DevFilter> find4DevId(String devId) {
        DevFilter filter=new DevFilter();
        filter.setDevId(devId);
        return mapper.queryList(filter);
    }
}
